package entity;

import java.math.BigDecimal;

public class EmpEntity {
    private Integer id;
    private String empName;
    private String gender;
    private BigDecimal salary;
    private Integer deptid;
    // 这个变量名是 DeptEntity 表
    private DeptEntity deptEntity;

    // 无参构造
    public EmpEntity() {
    }

    // 两个参数的构造函数
    public EmpEntity(int id, String empName) {
        this.id = id;
        this.empName = empName;
        System.out.println("有 int, String 的构造函数---");
    }

    // 带参构造
    public EmpEntity(Integer id, String empName, String gender, BigDecimal salary, Integer deptid) {
        this.id = id;
        this.empName = empName;
        this.gender = gender;
        this.salary = salary;
        this.deptid = deptid;
    }

    // getting / setting 方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public BigDecimal getSalary() {
        return salary;
    }

    public void setSalary(BigDecimal salary) {
        this.salary = salary;
    }

    public Integer getDeptid() {
        return deptid;
    }

    public void setDeptid(Integer deptid) {
        this.deptid = deptid;
    }

    // 这里的 getting/setting 方法是 DeptEntity 表的
    public DeptEntity getDeptEntity() {
        return deptEntity;
    }

    public void setDeptEntity(DeptEntity deptEntity) {
        this.deptEntity = deptEntity;
    }

    // 重写 toString 方法
    @Override
    public String toString() {
        return "EmpEntity{" +
                "id=" + id +
                ", empName='" + empName + '\'' +
                ", gender='" + gender + '\'' +
                ", salary=" + salary +
                ", deptid=" + deptid +
                '}';
    }
}
